package chapter7;

/**
 * @author yuh
 * @date 2018/5/4 10:50
 * @description
 */
public class MatrixZhuanzhi {

    static int[][] zhuanzhi(int[][] matrix) {
        int[][] matrix2 = new int[matrix[0].length][matrix.length];
        for (int i = 0; i < matrix.length; i++) {
            for (int j = 0; j < matrix[i].length; j++) {
                matrix2[j][i] = matrix[i][j];
            }
        }
        return matrix2;
    }

    public static void main(String[] args) {
        int[][] m = {
                {1, 2, 3},
                {1, 2, 3}
        };

        int[][] zhuanzhi = zhuanzhi(m);
        System.out.println();
    }
}
